﻿
var npage = 0;
function checkPageNum(obj, obj2) {
    var num = $("#pagetext").val();
    var p = /^[1-9]\d*$/;

    if (num.length < 1) {
        alert("请输入要跳转的页码");

    }
    else if (!p.exec(num)) {
        $("#pagetext").attr("value", 1);
        alert("要跳转的页码请输入正整数");
    }
    else if (num > obj) {
        $("#pagetext").attr("value", obj);
        npage = obj;

    }
    else if (num < 1) {
        $("#pagetext").attr("value", 1);
        npage = 1;

    }
    else {

    }

}
function pageUrl() {
    var obj =  $("#pager_type").val();
    window.location.href = '?page=' + $("#pagetext").val() + "&type=" + obj;
}
function pagerUrl(txt) {
    var obj = $("#pager_type").val();
    window.location.href = '?'+txt+'=' + $("#pagetext").val() + "&type=" + obj;
}


